// e31.c
#include <stdio.h>

int waysToMake(int amount, int coins[], int start, int end);

int main(int argc, char *argv[]) {
	if (argc != 2) {
		printf("usage: e31 n\n");
		return 1;
	}
	int coins[] = { 200, 100, 50, 20, 10, 5, 2, 1 };
	printf("%d\n", waysToMake(atoi(argv[1]), coins, 0, 8));
    return 0;
}

int waysToMake(int amount, int coins[], int start, int end) {
	if (amount == 0) return 1;
	if (end - start == 0 || amount < 0) return 0;
	return waysToMake(amount - coins[start], coins, start, end) + waysToMake(amount, coins, start + 1, end);
}
